package cn.getech.data.development.mapper;

import cn.getech.data.development.dto.JobNodeInfoDto;
import cn.getech.data.development.entity.JobNodeInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 任务节点信息表 Mapper 接口
 * </p>
 *
 * @author zenith
 * @since 2019-07-08
 */
@Mapper
public interface JobNodeInfoMapper extends BaseMapper<JobNodeInfo> {

    List<JobNodeInfoDto> selectListByIds(@Param("jobNodeIds") Set<Integer> jobNodeIds);

    List<JobNodeInfoDto> selectListByIds1(@Param("jobNodeIds") Set<Integer> jobNodeIds);

    void batchUpdate(@Param("nodes")List<JobNodeInfoDto> nodes);

    void batchUpdatePosOthers(@Param("nodes")List<JobNodeInfoDto> nodes, @Param("jobId")Long jobId);

    void clearPosOthers(@Param("jobId")Long jobId);

    List<JobNodeInfo> selectListByJobIds(@Param("jobIds") Set<Long> jobIds);

    void insertJobNode(@Param("jobNode") JobNodeInfo jobNode);

    void updateBatch(@Param("ids") List<Long> ids, @Param("assigneePerId") Integer assigneePerId);

    JobNodeInfo getJobNodeInfo(@Param("jobNodeId")String jobNodeId);

    void updatePosXY(@Param("newId") Integer newId);

    JobNodeInfo getDataById(@Param("jobNodeId")Integer jobNodeId);

    Long getConcurrentNum(@Param("jobNodeId")String jobNodeId);
}
